<?php
/**
 * 内容接口类
 * @return string
 * @Obelisk
 */
namespace app\modules\test\controllers;

use app\modules\test\models\TestCate;
use yii\console\Controller;

class ApiController extends Controller
{
    public $enableCsrfValidation = false;

    /**
     * 获取题目的二级分类
     * @return string
     * by  yanni
     */
    public function actionTestCate()
    {
        $cate = \Yii::$app->request->post('cate');
        $data =TestCate::find()->asArray()->where('pid='.$cate)->all();
        die(json_encode(['code' => 1, 'allCate' => $data]));
    }
}